package Text_004;

import java.util.Scanner;

public class CycleCode {
	public static void main(String[] agrs) {
		//输入字符串，并遍历，统计大写字母，小写字母和数字各有多少个。
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入一个字符串:");
		String str = scanner.next();
		int min = 0;
		int max = 0;
		int num = 0;
		for(int i=0;i<str.length();i++) {
			//遍历获取单个字符
			char c =str.charAt(i) ;
			if(c>='a'&&c<='z') {
				min++;
			}
			else if(c>='A'&&c<='Z') {
				max++;
			}
			else if(c>='0'&&c<='9') {
				num++;
			}
			System.out.print(c+" ");
		}
		System.out.println("\n"+"小写字母有"+min+"个,"+"大写字母有"+max+"个"+",数字有"+num+"个");
		
	}

}
